//
//  reChargeViewController.m
//  Recycling
//
//  Created by jzd on 2018/5/17.
//  Copyright © 2018年 宋佳. All rights reserved.
//

#import "reChargeViewController.h"
#import "payMoneyOrderVC.h"

@interface reChargeViewController ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topCons;
@property (weak, nonatomic) IBOutlet UITextField *moneyNum;

@end

@implementation reChargeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = BGCOLOR;
    self.navigationItem.title = @"充值";
    self.topCons.constant = statsBarHeight+NavgationBarH+5;
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.moneyNum becomeFirstResponder];
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [self.moneyNum resignFirstResponder];
}
- (IBAction)next:(UIButton *)sender {
    [self.moneyNum resignFirstResponder];
    float num = self.moneyNum.text.floatValue;
    if (self.moneyNum.text.length == 0 || num == 0.0) {
        [self.navigationController.view showToast:@"请输入充值金额" completion:nil];
        return;
    }
    payMoneyOrderVC *vc = [[payMoneyOrderVC alloc]init];
    vc.money = [self.moneyNum.text floatValue];
    [self.navigationController pushViewController:vc animated:YES];
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self.view endEditing:YES];
}

@end
